From db74d66e6c48f377c2b5ad0af9488e54fae38fd2 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Sun, 4 Nov 2012 01:02:43 -0800 Subject: [PATCH] Change copy of talk page link in personal tools Adds message with key "mytalk-parenthetical", specifying the text for "Talk" when it is wrapped in parentheses and conjoined to the user page label. Change is guarded by config variable "wgVectorCombineUserTalk", set to false by default (which preserves the old behavior). Per discussion on IRC and in https://bugzilla.wikimedia.org/show_bug.cgi?id=41672 Change-Id: I822a73901c9b220983356e9e4a4ad5e7f8ebc7f1 --- includes/DefaultSettings.php | 7 +++++++ languages/messages/MessagesEn.php | 21 +++++++++++---------- languages/messages/MessagesQqq.php | 5 ++--- skins/Vector.php | 26 +++++++++++++++++++++----- 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e57b9d7568..494b2a378b 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2781,6 +2781,13 @@ $wgFooterIcons = array( */ $wgUseCombinedLoginLink = false; +/** + * Appearance of user page and talk page labels in personal tools. + * - true = combine links into a single label + * - false = keep links in separate labels + */ +$wgVectorCombineUserTalk = false; + /** * Search form look for Vector skin only. * - true = use an icon search button diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index ab5e6a3874..ec3187216a 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -767,16 +767,17 @@ XHTML id names. 'linkprefix' => '/^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD', # only translate this message to other languages if you have to change it -'about' => 'About', -'article' => 'Content page', -'newwindow' => '(opens in new window)', -'cancel' => 'Cancel', -'moredotdotdot' => 'More...', -'mypage' => 'Page', -'mytalk' => 'Talk', -'anontalk' => 'Talk for this IP address', -'navigation' => 'Navigation', -'and' => ' and', +'about' => 'About', +'article' => 'Content page', +'newwindow' => '(opens in new window)', +'cancel' => 'Cancel', +'moredotdotdot' => 'More...', +'mypage' => 'Page', +'mytalk' => 'Talk', +'mytalk-parenthetical' => 'talk', +'anontalk' => 'Talk for this IP address', +'navigation' => 'Navigation', +'and' => ' and', # Cologne Blue skin 'qbfind' => 'Find', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 2b3c9764bb..a601b93e28 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -347,9 +347,8 @@ Possible alternatives to the word 'content' are 'subject matter' or 'wiki subjec {{Identical|Cancel}}', 'moredotdotdot' => '{{Identical|More...}}', 'mypage' => "A text for the link to the user's user page in the links at the top of the page.", -'mytalk' => 'In the personal urls page section - right upper corner. - -Used as link title in "Personal tools" toolbar.', +'mytalk' => 'Used as link title in "Personal tools" toolbar.', +'mytalk-parenthetical' => 'When user page and talk combined into single label, link title for talk label', 'anontalk' => 'Link to the talk page appearing in [[mw:Help:Navigation#User_Links|user links]] for each anonymous users when [[mw:Manual:$wgShowIPinHeader|$wgShowIPinHeader]] is true.', 'navigation' => 'This is shown as a section header in the sidebar of most skins. diff --git a/skins/Vector.php b/skins/Vector.php index 7fbca414b3..227d18d80f 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -361,7 +361,7 @@ class VectorTemplate extends BaseTemplate { * @param $elements array */ protected function renderNavigation( $elements ) { - global $wgVectorUseSimpleSearch; + global $wgVectorUseSimpleSearch, $wgVectorCombineUserTalk; // If only one element was given, wrap it in an array, allowing more // flexible arguments @@ -444,10 +444,26 @@ class VectorTemplate extends BaseTemplate {
msg( 'personaltools' ) ?>
html( 'userlangattributes' ) ?>> -getPersonalTools() as $key => $item ) { ?> - makeListItem( $key, $item ); ?> - - +getPersonalTools(); + if ( $wgVectorCombineUserTalk && isset( $personalTools['userpage'] ) ) { +?> +
  • +makeListItem( 'userpage', $personalTools['userpage'], array( 'tag' => 'span' ) ); +?> getMsg( 'mytalk-parenthetical' )->text(); + $talkItem = $this->makeListItem( 'mytalk', $personalTools['mytalk'], array( 'tag' => 'span' ) ); + echo $this->getMsg( 'parentheses' )->rawParams( $talkItem )->escaped(); + unset( $personalTools['userpage'], $personalTools['mytalk'] ); +?> +
  • + $item ) { + echo $this->makeListItem( $key, $item ); + } +?>